﻿using ChongJu.GlobalInfo;
using ChongJu.ModelManager;
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Data;

namespace ChoJu.Converters
{
    public class StartButtonEnableConverters : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var currtype = value.ToString().ToLower();
            var self = parameter.ToString().ToLower();
            var none = RunTypeEnum.None.ToString().ToLower();

            if (currtype == self || currtype == none)
                return true;
            else
                return false;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }

    public class StartButtonEnableOpacityConverters : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var currtype = value.ToString().ToLower();
            var self = parameter.ToString().ToLower();
            var none = RunTypeEnum.None.ToString().ToLower();

            if (currtype == self || currtype == none)
                return 1;
            else
                return 0.4;
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}
